/*
'===============================================================================
'  Generated From - CSharp_EasyObject_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL      = SQL_DAAB_StoredProcs.vbgen
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easily done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.Common;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using System.IO;

using Microsoft.Practices.EnterpriseLibrary.Data;
using NCI.EasyObjects;

namespace CMS.DAL
{

	#region Schema

	public class TourSchema : NCI.EasyObjects.Schema
	{
		private static ArrayList _entries;
		public static SchemaItem TourID = new SchemaItem("TourID", DbType.Int32, true, false, false, true, false, false);
		public static SchemaItem Title1 = new SchemaItem("Title1", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem Title2 = new SchemaItem("Title2", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem Title3 = new SchemaItem("Title3", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem InitContent1 = new SchemaItem("InitContent1", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem InitContent2 = new SchemaItem("InitContent2", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem InitContent3 = new SchemaItem("InitContent3", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem TourDurationID = new SchemaItem("TourDurationID", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem Content1 = new SchemaItem("Content1", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem Content2 = new SchemaItem("Content2", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem Content3 = new SchemaItem("Content3", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem Image = new SchemaItem("Image", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem StartDestinationID = new SchemaItem("StartDestinationID", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem ArrivedDestinationID = new SchemaItem("ArrivedDestinationID", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem SaleOffID = new SchemaItem("SaleOffID", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem TourCategoryID = new SchemaItem("TourCategoryID", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem Status = new SchemaItem("Status", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem Priority = new SchemaItem("Priority", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem IsCustomerTour = new SchemaItem("isCustomerTour", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem TripHighlight1 = new SchemaItem("TripHighlight1", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem TripHighlight2 = new SchemaItem("TripHighlight2", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem TripHighlight3 = new SchemaItem("TripHighlight3", DbType.StringFixedLength, SchemaItemJustify.None, 10, true, false, false, false);
		public static SchemaItem Price1 = new SchemaItem("Price1", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem Price2 = new SchemaItem("Price2", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem Price3 = new SchemaItem("Price3", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem HotelInfo1 = new SchemaItem("HotelInfo1", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem HotelInfo2 = new SchemaItem("HotelInfo2", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem HotelInfo3 = new SchemaItem("HotelInfo3", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem VideoLink = new SchemaItem("VideoLink", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);

		public override ArrayList SchemaEntries
		{
			get
			{
				if (_entries == null )
				{
					_entries = new ArrayList();
					_entries.Add(TourSchema.TourID);
					_entries.Add(TourSchema.Title1);
					_entries.Add(TourSchema.Title2);
					_entries.Add(TourSchema.Title3);
					_entries.Add(TourSchema.InitContent1);
					_entries.Add(TourSchema.InitContent2);
					_entries.Add(TourSchema.InitContent3);
					_entries.Add(TourSchema.TourDurationID);
					_entries.Add(TourSchema.Content1);
					_entries.Add(TourSchema.Content2);
					_entries.Add(TourSchema.Content3);
					_entries.Add(TourSchema.Image);
					_entries.Add(TourSchema.StartDestinationID);
					_entries.Add(TourSchema.ArrivedDestinationID);
					_entries.Add(TourSchema.SaleOffID);
					_entries.Add(TourSchema.TourCategoryID);
					_entries.Add(TourSchema.Status);
					_entries.Add(TourSchema.Priority);
					_entries.Add(TourSchema.IsCustomerTour);
					_entries.Add(TourSchema.TripHighlight1);
					_entries.Add(TourSchema.TripHighlight2);
					_entries.Add(TourSchema.TripHighlight3);
					_entries.Add(TourSchema.Price1);
					_entries.Add(TourSchema.Price2);
					_entries.Add(TourSchema.Price3);
					_entries.Add(TourSchema.HotelInfo1);
					_entries.Add(TourSchema.HotelInfo2);
					_entries.Add(TourSchema.HotelInfo3);
					_entries.Add(TourSchema.VideoLink);
				}
				return _entries;
			}
		}
		
		public static bool HasAutoKey 
		{
			get { return true;	}
		}

		public static bool HasRowID 
		{
			get { return false;	}
		}
	}
	#endregion

	public abstract class _Tour : EasyObject
	{

		public _Tour()
		{
			TourSchema _schema = new TourSchema();
			this.SchemaEntries = _schema.SchemaEntries;
			this.SchemaGlobal = "dbo";
		}
		
		public override void FlushData() 	 
		{ 	 
			this._whereClause = null; 	 
			this._aggregateClause = null; 	 
			base.FlushData(); 	 
		}
			   
		/// <summary>
		/// Loads the business object with info from the database, based on the requested primary key.
		/// </summary>
		/// <param name="TourID"></param>
		/// <returns>A Boolean indicating success or failure of the query</returns>
		public bool LoadByPrimaryKey(int TourID)
		{
			switch(this.DefaultCommandType)
			{
				case CommandType.StoredProcedure:
					ListDictionary parameters = new ListDictionary();

					// Add in parameters
					parameters.Add(TourSchema.TourID.FieldName, TourID);

					return base.LoadFromSql(this.SchemaStoredProcedureWithSeparator + "sp_GetTour", parameters, CommandType.StoredProcedure);

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					this.Where.TourID.Value = TourID;
					return this.Query.Load();

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}
	
		/// <summary>
		/// Loads all records from the table.
		/// </summary>
		/// <returns>A Boolean indicating success or failure of the query</returns>
		public bool LoadAll()
		{
			switch(this.DefaultCommandType)
			{
				case CommandType.StoredProcedure:
					return base.LoadFromSql(this.SchemaStoredProcedureWithSeparator + "sp_GetAllTour", null, CommandType.StoredProcedure);

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					return this.Query.Load();

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		/// <summary>
		/// Adds a new record to the internal table.
		/// </summary>
		public override void AddNew()
		{
			base.AddNew();
			this.ApplyDefaults();
		}

		/// <summary>
		/// Apply any default values to columns
		/// </summary>
		protected override void ApplyDefaults()
		{
		}

		protected override DbCommand GetInsertCommand(CommandType commandType)
		{	
			DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_AddTour";
					dbCommand = db.GetStoredProcCommand(sqlCommand);

					db.AddParameter(dbCommand, "TourID", DbType.Int32, 0, ParameterDirection.Output, true, 0, 0, "TourID", DataRowVersion.Default, Convert.DBNull);
					CreateParameters(db, dbCommand);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					foreach(SchemaItem item in this.SchemaEntries)
					{
						if (!item.IsComputed)
						{
							if ((item.IsAutoKey && this.IdentityInsert) || !item.IsAutoKey)
							{
								this.Query.AddInsertColumn(item);
							}
						}
					}
					dbCommand = this.Query.GetInsertCommandWrapper();

					dbCommand.Parameters.Clear();
					if (this.IdentityInsert)
					{
						db.AddInParameter(dbCommand, "TourID", DbType.Int32, "TourID", DataRowVersion.Default);
					}
					else
					{
						db.AddParameter(dbCommand, "TourID", DbType.Int32, 0, ParameterDirection.Output, true, 0, 0, "TourID", DataRowVersion.Default, Convert.DBNull);
					}
					CreateParameters(db, dbCommand);

					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		protected override DbCommand GetUpdateCommand(CommandType commandType)
		{
            DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_UpdateTour";
					dbCommand = db.GetStoredProcCommand(sqlCommand);

					db.AddInParameter(dbCommand, "TourID", DbType.Int32, "TourID", DataRowVersion.Current);
					CreateParameters(db, dbCommand);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					foreach(SchemaItem item in this.SchemaEntries)
					{
						if (!(item.IsAutoKey || item.IsComputed))
						{
							this.Query.AddUpdateColumn(item);
						}
					}

					this.Where.WhereClauseReset();
					this.Where.TourID.Operator = WhereParameter.Operand.Equal;
					dbCommand = this.Query.GetUpdateCommandWrapper();

					dbCommand.Parameters.Clear();
					CreateParameters(db, dbCommand);
					db.AddInParameter(dbCommand, "TourID", DbType.Int32, "TourID", DataRowVersion.Current);
					
					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		protected override DbCommand GetDeleteCommand(CommandType commandType)
		{
            DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_DeleteTour";
					dbCommand = db.GetStoredProcCommand(sqlCommand);
					db.AddInParameter(dbCommand, "TourID", DbType.Int32, "TourID", DataRowVersion.Current);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					this.Where.TourID.Operator = WhereParameter.Operand.Equal;
					dbCommand = this.Query.GetDeleteCommandWrapper();

					dbCommand.Parameters.Clear();
					db.AddInParameter(dbCommand, "TourID", DbType.Int32, "TourID", DataRowVersion.Current);
					
					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		private void CreateParameters(Database db, DbCommand dbCommand)
		{
			db.AddInParameter(dbCommand, "Title1", DbType.String, "Title1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Title2", DbType.String, "Title2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Title3", DbType.String, "Title3", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "InitContent1", DbType.String, "InitContent1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "InitContent2", DbType.String, "InitContent2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "InitContent3", DbType.String, "InitContent3", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "TourDurationID", DbType.Int32, "TourDurationID", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Content1", DbType.String, "Content1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Content2", DbType.String, "Content2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Content3", DbType.String, "Content3", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Image", DbType.String, "Image", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "StartDestinationID", DbType.Int32, "StartDestinationID", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "ArrivedDestinationID", DbType.Int32, "ArrivedDestinationID", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "SaleOffID", DbType.Int32, "SaleOffID", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "TourCategoryID", DbType.Int32, "TourCategoryID", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Status", DbType.Int32, "Status", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Priority", DbType.Int32, "Priority", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "isCustomerTour", DbType.Int32, "isCustomerTour", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "TripHighlight1", DbType.String, "TripHighlight1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "TripHighlight2", DbType.String, "TripHighlight2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "TripHighlight3", DbType.StringFixedLength, "TripHighlight3", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Price1", DbType.String, "Price1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Price2", DbType.String, "Price2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Price3", DbType.String, "Price3", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "HotelInfo1", DbType.String, "HotelInfo1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "HotelInfo2", DbType.String, "HotelInfo2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "HotelInfo3", DbType.String, "HotelInfo3", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "VideoLink", DbType.String, "VideoLink", DataRowVersion.Current);
		}
		
		#region Properties
		public virtual int TourID
		{
			get
			{
				return this.GetInteger(TourSchema.TourID.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.TourID.FieldName, value);
			}
		}
		public virtual string Title1
		{
			get
			{
				return this.GetString(TourSchema.Title1.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Title1.FieldName, value);
			}
		}
		public virtual string Title2
		{
			get
			{
				return this.GetString(TourSchema.Title2.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Title2.FieldName, value);
			}
		}
		public virtual string Title3
		{
			get
			{
				return this.GetString(TourSchema.Title3.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Title3.FieldName, value);
			}
		}
		public virtual string InitContent1
		{
			get
			{
				return this.GetString(TourSchema.InitContent1.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.InitContent1.FieldName, value);
			}
		}
		public virtual string InitContent2
		{
			get
			{
				return this.GetString(TourSchema.InitContent2.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.InitContent2.FieldName, value);
			}
		}
		public virtual string InitContent3
		{
			get
			{
				return this.GetString(TourSchema.InitContent3.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.InitContent3.FieldName, value);
			}
		}
		public virtual int TourDurationID
		{
			get
			{
				return this.GetInteger(TourSchema.TourDurationID.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.TourDurationID.FieldName, value);
			}
		}
		public virtual string Content1
		{
			get
			{
				return this.GetString(TourSchema.Content1.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Content1.FieldName, value);
			}
		}
		public virtual string Content2
		{
			get
			{
				return this.GetString(TourSchema.Content2.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Content2.FieldName, value);
			}
		}
		public virtual string Content3
		{
			get
			{
				return this.GetString(TourSchema.Content3.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Content3.FieldName, value);
			}
		}
		public virtual string Image
		{
			get
			{
				return this.GetString(TourSchema.Image.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Image.FieldName, value);
			}
		}
		public virtual int StartDestinationID
		{
			get
			{
				return this.GetInteger(TourSchema.StartDestinationID.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.StartDestinationID.FieldName, value);
			}
		}
		public virtual int ArrivedDestinationID
		{
			get
			{
				return this.GetInteger(TourSchema.ArrivedDestinationID.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.ArrivedDestinationID.FieldName, value);
			}
		}
		public virtual int SaleOffID
		{
			get
			{
				return this.GetInteger(TourSchema.SaleOffID.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.SaleOffID.FieldName, value);
			}
		}
		public virtual int TourCategoryID
		{
			get
			{
				return this.GetInteger(TourSchema.TourCategoryID.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.TourCategoryID.FieldName, value);
			}
		}
		public virtual int Status
		{
			get
			{
				return this.GetInteger(TourSchema.Status.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.Status.FieldName, value);
			}
		}
		public virtual int Priority
		{
			get
			{
				return this.GetInteger(TourSchema.Priority.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.Priority.FieldName, value);
			}
		}
		public virtual int IsCustomerTour
		{
			get
			{
				return this.GetInteger(TourSchema.IsCustomerTour.FieldName);
	    	}
			set
			{
				this.SetInteger(TourSchema.IsCustomerTour.FieldName, value);
			}
		}
		public virtual string TripHighlight1
		{
			get
			{
				return this.GetString(TourSchema.TripHighlight1.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.TripHighlight1.FieldName, value);
			}
		}
		public virtual string TripHighlight2
		{
			get
			{
				return this.GetString(TourSchema.TripHighlight2.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.TripHighlight2.FieldName, value);
			}
		}
		public virtual string TripHighlight3
		{
			get
			{
				return this.GetString(TourSchema.TripHighlight3.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.TripHighlight3.FieldName, value);
			}
		}
		public virtual string Price1
		{
			get
			{
				return this.GetString(TourSchema.Price1.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Price1.FieldName, value);
			}
		}
		public virtual string Price2
		{
			get
			{
				return this.GetString(TourSchema.Price2.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Price2.FieldName, value);
			}
		}
		public virtual string Price3
		{
			get
			{
				return this.GetString(TourSchema.Price3.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.Price3.FieldName, value);
			}
		}
		public virtual string HotelInfo1
		{
			get
			{
				return this.GetString(TourSchema.HotelInfo1.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.HotelInfo1.FieldName, value);
			}
		}
		public virtual string HotelInfo2
		{
			get
			{
				return this.GetString(TourSchema.HotelInfo2.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.HotelInfo2.FieldName, value);
			}
		}
		public virtual string HotelInfo3
		{
			get
			{
				return this.GetString(TourSchema.HotelInfo3.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.HotelInfo3.FieldName, value);
			}
		}
		public virtual string VideoLink
		{
			get
			{
				return this.GetString(TourSchema.VideoLink.FieldName);
	    	}
			set
			{
				this.SetString(TourSchema.VideoLink.FieldName, value);
			}
		}

		public override string TableName
		{
			get { return "Tour"; }
		}
		
		#endregion		
		
		#region String Properties
		public virtual string s_TourID
		{
			get
			{
			    return this.IsColumnNull(TourSchema.TourID.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.TourID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.TourID.FieldName);
			    else
			        this.TourID = base.SetIntegerAsString(TourSchema.TourID.FieldName, value);
			}
		}
		public virtual string s_Title1
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Title1.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Title1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Title1.FieldName);
			    else
			        this.Title1 = base.SetStringAsString(TourSchema.Title1.FieldName, value);
			}
		}
		public virtual string s_Title2
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Title2.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Title2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Title2.FieldName);
			    else
			        this.Title2 = base.SetStringAsString(TourSchema.Title2.FieldName, value);
			}
		}
		public virtual string s_Title3
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Title3.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Title3.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Title3.FieldName);
			    else
			        this.Title3 = base.SetStringAsString(TourSchema.Title3.FieldName, value);
			}
		}
		public virtual string s_InitContent1
		{
			get
			{
			    return this.IsColumnNull(TourSchema.InitContent1.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.InitContent1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.InitContent1.FieldName);
			    else
			        this.InitContent1 = base.SetStringAsString(TourSchema.InitContent1.FieldName, value);
			}
		}
		public virtual string s_InitContent2
		{
			get
			{
			    return this.IsColumnNull(TourSchema.InitContent2.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.InitContent2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.InitContent2.FieldName);
			    else
			        this.InitContent2 = base.SetStringAsString(TourSchema.InitContent2.FieldName, value);
			}
		}
		public virtual string s_InitContent3
		{
			get
			{
			    return this.IsColumnNull(TourSchema.InitContent3.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.InitContent3.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.InitContent3.FieldName);
			    else
			        this.InitContent3 = base.SetStringAsString(TourSchema.InitContent3.FieldName, value);
			}
		}
		public virtual string s_TourDurationID
		{
			get
			{
			    return this.IsColumnNull(TourSchema.TourDurationID.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.TourDurationID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.TourDurationID.FieldName);
			    else
			        this.TourDurationID = base.SetIntegerAsString(TourSchema.TourDurationID.FieldName, value);
			}
		}
		public virtual string s_Content1
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Content1.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Content1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Content1.FieldName);
			    else
			        this.Content1 = base.SetStringAsString(TourSchema.Content1.FieldName, value);
			}
		}
		public virtual string s_Content2
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Content2.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Content2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Content2.FieldName);
			    else
			        this.Content2 = base.SetStringAsString(TourSchema.Content2.FieldName, value);
			}
		}
		public virtual string s_Content3
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Content3.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Content3.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Content3.FieldName);
			    else
			        this.Content3 = base.SetStringAsString(TourSchema.Content3.FieldName, value);
			}
		}
		public virtual string s_Image
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Image.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Image.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Image.FieldName);
			    else
			        this.Image = base.SetStringAsString(TourSchema.Image.FieldName, value);
			}
		}
		public virtual string s_StartDestinationID
		{
			get
			{
			    return this.IsColumnNull(TourSchema.StartDestinationID.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.StartDestinationID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.StartDestinationID.FieldName);
			    else
			        this.StartDestinationID = base.SetIntegerAsString(TourSchema.StartDestinationID.FieldName, value);
			}
		}
		public virtual string s_ArrivedDestinationID
		{
			get
			{
			    return this.IsColumnNull(TourSchema.ArrivedDestinationID.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.ArrivedDestinationID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.ArrivedDestinationID.FieldName);
			    else
			        this.ArrivedDestinationID = base.SetIntegerAsString(TourSchema.ArrivedDestinationID.FieldName, value);
			}
		}
		public virtual string s_SaleOffID
		{
			get
			{
			    return this.IsColumnNull(TourSchema.SaleOffID.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.SaleOffID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.SaleOffID.FieldName);
			    else
			        this.SaleOffID = base.SetIntegerAsString(TourSchema.SaleOffID.FieldName, value);
			}
		}
		public virtual string s_TourCategoryID
		{
			get
			{
			    return this.IsColumnNull(TourSchema.TourCategoryID.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.TourCategoryID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.TourCategoryID.FieldName);
			    else
			        this.TourCategoryID = base.SetIntegerAsString(TourSchema.TourCategoryID.FieldName, value);
			}
		}
		public virtual string s_Status
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Status.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.Status.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Status.FieldName);
			    else
			        this.Status = base.SetIntegerAsString(TourSchema.Status.FieldName, value);
			}
		}
		public virtual string s_Priority
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Priority.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.Priority.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Priority.FieldName);
			    else
			        this.Priority = base.SetIntegerAsString(TourSchema.Priority.FieldName, value);
			}
		}
		public virtual string s_IsCustomerTour
		{
			get
			{
			    return this.IsColumnNull(TourSchema.IsCustomerTour.FieldName) ? string.Empty : base.GetIntegerAsString(TourSchema.IsCustomerTour.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.IsCustomerTour.FieldName);
			    else
			        this.IsCustomerTour = base.SetIntegerAsString(TourSchema.IsCustomerTour.FieldName, value);
			}
		}
		public virtual string s_TripHighlight1
		{
			get
			{
			    return this.IsColumnNull(TourSchema.TripHighlight1.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.TripHighlight1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.TripHighlight1.FieldName);
			    else
			        this.TripHighlight1 = base.SetStringAsString(TourSchema.TripHighlight1.FieldName, value);
			}
		}
		public virtual string s_TripHighlight2
		{
			get
			{
			    return this.IsColumnNull(TourSchema.TripHighlight2.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.TripHighlight2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.TripHighlight2.FieldName);
			    else
			        this.TripHighlight2 = base.SetStringAsString(TourSchema.TripHighlight2.FieldName, value);
			}
		}
		public virtual string s_TripHighlight3
		{
			get
			{
			    return this.IsColumnNull(TourSchema.TripHighlight3.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.TripHighlight3.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.TripHighlight3.FieldName);
			    else
			        this.TripHighlight3 = base.SetStringAsString(TourSchema.TripHighlight3.FieldName, value);
			}
		}
		public virtual string s_Price1
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Price1.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Price1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Price1.FieldName);
			    else
			        this.Price1 = base.SetStringAsString(TourSchema.Price1.FieldName, value);
			}
		}
		public virtual string s_Price2
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Price2.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Price2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Price2.FieldName);
			    else
			        this.Price2 = base.SetStringAsString(TourSchema.Price2.FieldName, value);
			}
		}
		public virtual string s_Price3
		{
			get
			{
			    return this.IsColumnNull(TourSchema.Price3.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.Price3.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.Price3.FieldName);
			    else
			        this.Price3 = base.SetStringAsString(TourSchema.Price3.FieldName, value);
			}
		}
		public virtual string s_HotelInfo1
		{
			get
			{
			    return this.IsColumnNull(TourSchema.HotelInfo1.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.HotelInfo1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.HotelInfo1.FieldName);
			    else
			        this.HotelInfo1 = base.SetStringAsString(TourSchema.HotelInfo1.FieldName, value);
			}
		}
		public virtual string s_HotelInfo2
		{
			get
			{
			    return this.IsColumnNull(TourSchema.HotelInfo2.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.HotelInfo2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.HotelInfo2.FieldName);
			    else
			        this.HotelInfo2 = base.SetStringAsString(TourSchema.HotelInfo2.FieldName, value);
			}
		}
		public virtual string s_HotelInfo3
		{
			get
			{
			    return this.IsColumnNull(TourSchema.HotelInfo3.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.HotelInfo3.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.HotelInfo3.FieldName);
			    else
			        this.HotelInfo3 = base.SetStringAsString(TourSchema.HotelInfo3.FieldName, value);
			}
		}
		public virtual string s_VideoLink
		{
			get
			{
			    return this.IsColumnNull(TourSchema.VideoLink.FieldName) ? string.Empty : base.GetStringAsString(TourSchema.VideoLink.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(TourSchema.VideoLink.FieldName);
			    else
			        this.VideoLink = base.SetStringAsString(TourSchema.VideoLink.FieldName, value);
			}
		}
		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(EasyObject entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter TourID
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.TourID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Title1
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Title1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Title2
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Title2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Title3
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Title3);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter InitContent1
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.InitContent1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter InitContent2
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.InitContent2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter InitContent3
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.InitContent3);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter TourDurationID
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.TourDurationID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Content1
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Content1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Content2
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Content2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Content3
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Content3);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Image
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Image);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter StartDestinationID
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.StartDestinationID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter ArrivedDestinationID
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.ArrivedDestinationID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter SaleOffID
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.SaleOffID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter TourCategoryID
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.TourCategoryID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Status
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Status);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Priority
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Priority);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter IsCustomerTour
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.IsCustomerTour);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter TripHighlight1
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.TripHighlight1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter TripHighlight2
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.TripHighlight2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter TripHighlight3
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.TripHighlight3);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Price1
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Price1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Price2
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Price2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Price3
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.Price3);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter HotelInfo1
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.HotelInfo1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter HotelInfo2
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.HotelInfo2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter HotelInfo3
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.HotelInfo3);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter VideoLink
				{
					get
					{
							WhereParameter wp = new WhereParameter(TourSchema.VideoLink);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter TourID
		    {
				get
		        {
					if(_TourID_W == null)
	        	    {
						_TourID_W = TearOff.TourID;
					}
					return _TourID_W;
				}
			}

			public WhereParameter Title1
		    {
				get
		        {
					if(_Title1_W == null)
	        	    {
						_Title1_W = TearOff.Title1;
					}
					return _Title1_W;
				}
			}

			public WhereParameter Title2
		    {
				get
		        {
					if(_Title2_W == null)
	        	    {
						_Title2_W = TearOff.Title2;
					}
					return _Title2_W;
				}
			}

			public WhereParameter Title3
		    {
				get
		        {
					if(_Title3_W == null)
	        	    {
						_Title3_W = TearOff.Title3;
					}
					return _Title3_W;
				}
			}

			public WhereParameter InitContent1
		    {
				get
		        {
					if(_InitContent1_W == null)
	        	    {
						_InitContent1_W = TearOff.InitContent1;
					}
					return _InitContent1_W;
				}
			}

			public WhereParameter InitContent2
		    {
				get
		        {
					if(_InitContent2_W == null)
	        	    {
						_InitContent2_W = TearOff.InitContent2;
					}
					return _InitContent2_W;
				}
			}

			public WhereParameter InitContent3
		    {
				get
		        {
					if(_InitContent3_W == null)
	        	    {
						_InitContent3_W = TearOff.InitContent3;
					}
					return _InitContent3_W;
				}
			}

			public WhereParameter TourDurationID
		    {
				get
		        {
					if(_TourDurationID_W == null)
	        	    {
						_TourDurationID_W = TearOff.TourDurationID;
					}
					return _TourDurationID_W;
				}
			}

			public WhereParameter Content1
		    {
				get
		        {
					if(_Content1_W == null)
	        	    {
						_Content1_W = TearOff.Content1;
					}
					return _Content1_W;
				}
			}

			public WhereParameter Content2
		    {
				get
		        {
					if(_Content2_W == null)
	        	    {
						_Content2_W = TearOff.Content2;
					}
					return _Content2_W;
				}
			}

			public WhereParameter Content3
		    {
				get
		        {
					if(_Content3_W == null)
	        	    {
						_Content3_W = TearOff.Content3;
					}
					return _Content3_W;
				}
			}

			public WhereParameter Image
		    {
				get
		        {
					if(_Image_W == null)
	        	    {
						_Image_W = TearOff.Image;
					}
					return _Image_W;
				}
			}

			public WhereParameter StartDestinationID
		    {
				get
		        {
					if(_StartDestinationID_W == null)
	        	    {
						_StartDestinationID_W = TearOff.StartDestinationID;
					}
					return _StartDestinationID_W;
				}
			}

			public WhereParameter ArrivedDestinationID
		    {
				get
		        {
					if(_ArrivedDestinationID_W == null)
	        	    {
						_ArrivedDestinationID_W = TearOff.ArrivedDestinationID;
					}
					return _ArrivedDestinationID_W;
				}
			}

			public WhereParameter SaleOffID
		    {
				get
		        {
					if(_SaleOffID_W == null)
	        	    {
						_SaleOffID_W = TearOff.SaleOffID;
					}
					return _SaleOffID_W;
				}
			}

			public WhereParameter TourCategoryID
		    {
				get
		        {
					if(_TourCategoryID_W == null)
	        	    {
						_TourCategoryID_W = TearOff.TourCategoryID;
					}
					return _TourCategoryID_W;
				}
			}

			public WhereParameter Status
		    {
				get
		        {
					if(_Status_W == null)
	        	    {
						_Status_W = TearOff.Status;
					}
					return _Status_W;
				}
			}

			public WhereParameter Priority
		    {
				get
		        {
					if(_Priority_W == null)
	        	    {
						_Priority_W = TearOff.Priority;
					}
					return _Priority_W;
				}
			}

			public WhereParameter IsCustomerTour
		    {
				get
		        {
					if(_IsCustomerTour_W == null)
	        	    {
						_IsCustomerTour_W = TearOff.IsCustomerTour;
					}
					return _IsCustomerTour_W;
				}
			}

			public WhereParameter TripHighlight1
		    {
				get
		        {
					if(_TripHighlight1_W == null)
	        	    {
						_TripHighlight1_W = TearOff.TripHighlight1;
					}
					return _TripHighlight1_W;
				}
			}

			public WhereParameter TripHighlight2
		    {
				get
		        {
					if(_TripHighlight2_W == null)
	        	    {
						_TripHighlight2_W = TearOff.TripHighlight2;
					}
					return _TripHighlight2_W;
				}
			}

			public WhereParameter TripHighlight3
		    {
				get
		        {
					if(_TripHighlight3_W == null)
	        	    {
						_TripHighlight3_W = TearOff.TripHighlight3;
					}
					return _TripHighlight3_W;
				}
			}

			public WhereParameter Price1
		    {
				get
		        {
					if(_Price1_W == null)
	        	    {
						_Price1_W = TearOff.Price1;
					}
					return _Price1_W;
				}
			}

			public WhereParameter Price2
		    {
				get
		        {
					if(_Price2_W == null)
	        	    {
						_Price2_W = TearOff.Price2;
					}
					return _Price2_W;
				}
			}

			public WhereParameter Price3
		    {
				get
		        {
					if(_Price3_W == null)
	        	    {
						_Price3_W = TearOff.Price3;
					}
					return _Price3_W;
				}
			}

			public WhereParameter HotelInfo1
		    {
				get
		        {
					if(_HotelInfo1_W == null)
	        	    {
						_HotelInfo1_W = TearOff.HotelInfo1;
					}
					return _HotelInfo1_W;
				}
			}

			public WhereParameter HotelInfo2
		    {
				get
		        {
					if(_HotelInfo2_W == null)
	        	    {
						_HotelInfo2_W = TearOff.HotelInfo2;
					}
					return _HotelInfo2_W;
				}
			}

			public WhereParameter HotelInfo3
		    {
				get
		        {
					if(_HotelInfo3_W == null)
	        	    {
						_HotelInfo3_W = TearOff.HotelInfo3;
					}
					return _HotelInfo3_W;
				}
			}

			public WhereParameter VideoLink
		    {
				get
		        {
					if(_VideoLink_W == null)
	        	    {
						_VideoLink_W = TearOff.VideoLink;
					}
					return _VideoLink_W;
				}
			}

			private WhereParameter _TourID_W = null;
			private WhereParameter _Title1_W = null;
			private WhereParameter _Title2_W = null;
			private WhereParameter _Title3_W = null;
			private WhereParameter _InitContent1_W = null;
			private WhereParameter _InitContent2_W = null;
			private WhereParameter _InitContent3_W = null;
			private WhereParameter _TourDurationID_W = null;
			private WhereParameter _Content1_W = null;
			private WhereParameter _Content2_W = null;
			private WhereParameter _Content3_W = null;
			private WhereParameter _Image_W = null;
			private WhereParameter _StartDestinationID_W = null;
			private WhereParameter _ArrivedDestinationID_W = null;
			private WhereParameter _SaleOffID_W = null;
			private WhereParameter _TourCategoryID_W = null;
			private WhereParameter _Status_W = null;
			private WhereParameter _Priority_W = null;
			private WhereParameter _IsCustomerTour_W = null;
			private WhereParameter _TripHighlight1_W = null;
			private WhereParameter _TripHighlight2_W = null;
			private WhereParameter _TripHighlight3_W = null;
			private WhereParameter _Price1_W = null;
			private WhereParameter _Price2_W = null;
			private WhereParameter _Price3_W = null;
			private WhereParameter _HotelInfo1_W = null;
			private WhereParameter _HotelInfo2_W = null;
			private WhereParameter _HotelInfo3_W = null;
			private WhereParameter _VideoLink_W = null;

			public void WhereClauseReset()
			{
				_TourID_W = null;
				_Title1_W = null;
				_Title2_W = null;
				_Title3_W = null;
				_InitContent1_W = null;
				_InitContent2_W = null;
				_InitContent3_W = null;
				_TourDurationID_W = null;
				_Content1_W = null;
				_Content2_W = null;
				_Content3_W = null;
				_Image_W = null;
				_StartDestinationID_W = null;
				_ArrivedDestinationID_W = null;
				_SaleOffID_W = null;
				_TourCategoryID_W = null;
				_Status_W = null;
				_Priority_W = null;
				_IsCustomerTour_W = null;
				_TripHighlight1_W = null;
				_TripHighlight2_W = null;
				_TripHighlight3_W = null;
				_Price1_W = null;
				_Price2_W = null;
				_Price3_W = null;
				_HotelInfo1_W = null;
				_HotelInfo2_W = null;
				_HotelInfo3_W = null;
				_VideoLink_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private EasyObject _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
		
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(EasyObject entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter TourID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.TourID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Title1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Title1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Title2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Title2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Title3
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Title3);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter InitContent1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.InitContent1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter InitContent2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.InitContent2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter InitContent3
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.InitContent3);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter TourDurationID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.TourDurationID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Content1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Content1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Content2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Content2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Content3
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Content3);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Image
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Image);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter StartDestinationID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.StartDestinationID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter ArrivedDestinationID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.ArrivedDestinationID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter SaleOffID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.SaleOffID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter TourCategoryID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.TourCategoryID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Status
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Status);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Priority
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Priority);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter IsCustomerTour
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.IsCustomerTour);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter TripHighlight1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.TripHighlight1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter TripHighlight2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.TripHighlight2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter TripHighlight3
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.TripHighlight3);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Price1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Price1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Price2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Price2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Price3
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.Price3);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter HotelInfo1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.HotelInfo1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter HotelInfo2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.HotelInfo2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter HotelInfo3
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.HotelInfo3);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter VideoLink
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(TourSchema.VideoLink);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter TourID
		    {
				get
		        {
					if(_TourID_W == null)
	        	    {
						_TourID_W = TearOff.TourID;
					}
					return _TourID_W;
				}
			}

			public AggregateParameter Title1
		    {
				get
		        {
					if(_Title1_W == null)
	        	    {
						_Title1_W = TearOff.Title1;
					}
					return _Title1_W;
				}
			}

			public AggregateParameter Title2
		    {
				get
		        {
					if(_Title2_W == null)
	        	    {
						_Title2_W = TearOff.Title2;
					}
					return _Title2_W;
				}
			}

			public AggregateParameter Title3
		    {
				get
		        {
					if(_Title3_W == null)
	        	    {
						_Title3_W = TearOff.Title3;
					}
					return _Title3_W;
				}
			}

			public AggregateParameter InitContent1
		    {
				get
		        {
					if(_InitContent1_W == null)
	        	    {
						_InitContent1_W = TearOff.InitContent1;
					}
					return _InitContent1_W;
				}
			}

			public AggregateParameter InitContent2
		    {
				get
		        {
					if(_InitContent2_W == null)
	        	    {
						_InitContent2_W = TearOff.InitContent2;
					}
					return _InitContent2_W;
				}
			}

			public AggregateParameter InitContent3
		    {
				get
		        {
					if(_InitContent3_W == null)
	        	    {
						_InitContent3_W = TearOff.InitContent3;
					}
					return _InitContent3_W;
				}
			}

			public AggregateParameter TourDurationID
		    {
				get
		        {
					if(_TourDurationID_W == null)
	        	    {
						_TourDurationID_W = TearOff.TourDurationID;
					}
					return _TourDurationID_W;
				}
			}

			public AggregateParameter Content1
		    {
				get
		        {
					if(_Content1_W == null)
	        	    {
						_Content1_W = TearOff.Content1;
					}
					return _Content1_W;
				}
			}

			public AggregateParameter Content2
		    {
				get
		        {
					if(_Content2_W == null)
	        	    {
						_Content2_W = TearOff.Content2;
					}
					return _Content2_W;
				}
			}

			public AggregateParameter Content3
		    {
				get
		        {
					if(_Content3_W == null)
	        	    {
						_Content3_W = TearOff.Content3;
					}
					return _Content3_W;
				}
			}

			public AggregateParameter Image
		    {
				get
		        {
					if(_Image_W == null)
	        	    {
						_Image_W = TearOff.Image;
					}
					return _Image_W;
				}
			}

			public AggregateParameter StartDestinationID
		    {
				get
		        {
					if(_StartDestinationID_W == null)
	        	    {
						_StartDestinationID_W = TearOff.StartDestinationID;
					}
					return _StartDestinationID_W;
				}
			}

			public AggregateParameter ArrivedDestinationID
		    {
				get
		        {
					if(_ArrivedDestinationID_W == null)
	        	    {
						_ArrivedDestinationID_W = TearOff.ArrivedDestinationID;
					}
					return _ArrivedDestinationID_W;
				}
			}

			public AggregateParameter SaleOffID
		    {
				get
		        {
					if(_SaleOffID_W == null)
	        	    {
						_SaleOffID_W = TearOff.SaleOffID;
					}
					return _SaleOffID_W;
				}
			}

			public AggregateParameter TourCategoryID
		    {
				get
		        {
					if(_TourCategoryID_W == null)
	        	    {
						_TourCategoryID_W = TearOff.TourCategoryID;
					}
					return _TourCategoryID_W;
				}
			}

			public AggregateParameter Status
		    {
				get
		        {
					if(_Status_W == null)
	        	    {
						_Status_W = TearOff.Status;
					}
					return _Status_W;
				}
			}

			public AggregateParameter Priority
		    {
				get
		        {
					if(_Priority_W == null)
	        	    {
						_Priority_W = TearOff.Priority;
					}
					return _Priority_W;
				}
			}

			public AggregateParameter IsCustomerTour
		    {
				get
		        {
					if(_IsCustomerTour_W == null)
	        	    {
						_IsCustomerTour_W = TearOff.IsCustomerTour;
					}
					return _IsCustomerTour_W;
				}
			}

			public AggregateParameter TripHighlight1
		    {
				get
		        {
					if(_TripHighlight1_W == null)
	        	    {
						_TripHighlight1_W = TearOff.TripHighlight1;
					}
					return _TripHighlight1_W;
				}
			}

			public AggregateParameter TripHighlight2
		    {
				get
		        {
					if(_TripHighlight2_W == null)
	        	    {
						_TripHighlight2_W = TearOff.TripHighlight2;
					}
					return _TripHighlight2_W;
				}
			}

			public AggregateParameter TripHighlight3
		    {
				get
		        {
					if(_TripHighlight3_W == null)
	        	    {
						_TripHighlight3_W = TearOff.TripHighlight3;
					}
					return _TripHighlight3_W;
				}
			}

			public AggregateParameter Price1
		    {
				get
		        {
					if(_Price1_W == null)
	        	    {
						_Price1_W = TearOff.Price1;
					}
					return _Price1_W;
				}
			}

			public AggregateParameter Price2
		    {
				get
		        {
					if(_Price2_W == null)
	        	    {
						_Price2_W = TearOff.Price2;
					}
					return _Price2_W;
				}
			}

			public AggregateParameter Price3
		    {
				get
		        {
					if(_Price3_W == null)
	        	    {
						_Price3_W = TearOff.Price3;
					}
					return _Price3_W;
				}
			}

			public AggregateParameter HotelInfo1
		    {
				get
		        {
					if(_HotelInfo1_W == null)
	        	    {
						_HotelInfo1_W = TearOff.HotelInfo1;
					}
					return _HotelInfo1_W;
				}
			}

			public AggregateParameter HotelInfo2
		    {
				get
		        {
					if(_HotelInfo2_W == null)
	        	    {
						_HotelInfo2_W = TearOff.HotelInfo2;
					}
					return _HotelInfo2_W;
				}
			}

			public AggregateParameter HotelInfo3
		    {
				get
		        {
					if(_HotelInfo3_W == null)
	        	    {
						_HotelInfo3_W = TearOff.HotelInfo3;
					}
					return _HotelInfo3_W;
				}
			}

			public AggregateParameter VideoLink
		    {
				get
		        {
					if(_VideoLink_W == null)
	        	    {
						_VideoLink_W = TearOff.VideoLink;
					}
					return _VideoLink_W;
				}
			}

			private AggregateParameter _TourID_W = null;
			private AggregateParameter _Title1_W = null;
			private AggregateParameter _Title2_W = null;
			private AggregateParameter _Title3_W = null;
			private AggregateParameter _InitContent1_W = null;
			private AggregateParameter _InitContent2_W = null;
			private AggregateParameter _InitContent3_W = null;
			private AggregateParameter _TourDurationID_W = null;
			private AggregateParameter _Content1_W = null;
			private AggregateParameter _Content2_W = null;
			private AggregateParameter _Content3_W = null;
			private AggregateParameter _Image_W = null;
			private AggregateParameter _StartDestinationID_W = null;
			private AggregateParameter _ArrivedDestinationID_W = null;
			private AggregateParameter _SaleOffID_W = null;
			private AggregateParameter _TourCategoryID_W = null;
			private AggregateParameter _Status_W = null;
			private AggregateParameter _Priority_W = null;
			private AggregateParameter _IsCustomerTour_W = null;
			private AggregateParameter _TripHighlight1_W = null;
			private AggregateParameter _TripHighlight2_W = null;
			private AggregateParameter _TripHighlight3_W = null;
			private AggregateParameter _Price1_W = null;
			private AggregateParameter _Price2_W = null;
			private AggregateParameter _Price3_W = null;
			private AggregateParameter _HotelInfo1_W = null;
			private AggregateParameter _HotelInfo2_W = null;
			private AggregateParameter _HotelInfo3_W = null;
			private AggregateParameter _VideoLink_W = null;

			public void AggregateClauseReset()
			{
				_TourID_W = null;
				_Title1_W = null;
				_Title2_W = null;
				_Title3_W = null;
				_InitContent1_W = null;
				_InitContent2_W = null;
				_InitContent3_W = null;
				_TourDurationID_W = null;
				_Content1_W = null;
				_Content2_W = null;
				_Content3_W = null;
				_Image_W = null;
				_StartDestinationID_W = null;
				_ArrivedDestinationID_W = null;
				_SaleOffID_W = null;
				_TourCategoryID_W = null;
				_Status_W = null;
				_Priority_W = null;
				_IsCustomerTour_W = null;
				_TripHighlight1_W = null;
				_TripHighlight2_W = null;
				_TripHighlight3_W = null;
				_Price1_W = null;
				_Price2_W = null;
				_Price3_W = null;
				_HotelInfo1_W = null;
				_HotelInfo2_W = null;
				_HotelInfo3_W = null;
				_VideoLink_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private EasyObject _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	}
}
